package com.jingdianjichi.auth.common.enums;

import lombok.Getter;

/**
 * Description: 删除状态枚举
 * Copyright: Copyright (c) 2024
 * Create Time: 2024-07-03 15:44
 *
 * @author wanglianyun
 */
@Getter
public enum IsDeletedFlagEnum {

    DELETED(1, "已删除"),

    UN_DELETED(0, "未删除");

    private int code;

    private String desc;

    IsDeletedFlagEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IsDeletedFlagEnum getByCode(int codeVal) {
        for (IsDeletedFlagEnum resultCodeEnum : IsDeletedFlagEnum.values()) {
            if (resultCodeEnum.code == codeVal) {
                return resultCodeEnum;
            }
        }

        return null;
    }
}
